package cn.neusoft.customer.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class CustomerConsumer {
    @RabbitListener(queues = "customerQueue")
    public void listen(String message) {
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        log.info("Received a message from the queue. Message: {}", message);
    }
}


